package com.zy.algorithm.v3

import com.zy.activity.BaseMenuActivity
import com.zy.activity.bean.BaseMenuBean
import android.content.Intent
import com.zy.algorithm.v3.array.*
import java.util.ArrayList

//var ac: Activity? = null  //内存泄漏测试点

internal class AlgorithmV3ArrayActivity : BaseMenuActivity() {
    override fun init(list: ArrayList<BaseMenuBean>) {
        //ac = this
        list.add(BaseMenuBean("数组算法"))
        list.add(BaseMenuBean("150-3-26. 删除有序数组中的重复项", D3LeetCode0026::class.java))
        list.add(BaseMenuBean("150-4-80. 删除有序数组中的重复项 II", D4LeetCode0080::class.java))
        list.add(BaseMenuBean("1. 两数之和(暴力解法)", LeetCode0001::class.java))
        list.add(BaseMenuBean("1. 两数之和(hash解法)", LeetCode0001_2::class.java))
        list.add(BaseMenuBean("2. 两数相加(随机)", LeetCode0002::class.java))
        list.add(BaseMenuBean("2. 两数相加(进位)", LeetCode0002::class.java, 1))
        list.add(BaseMenuBean("27. 移除元素(简单)", LeetCode0027::class.java))
        list.add(BaseMenuBean("88. 合并两个有序数组(0)", LeetCode0088::class.java))
        list.add(BaseMenuBean("88. 合并两个有序数组(1)", LeetCode0088::class.java, 1))
        list.add(BaseMenuBean("88. 合并两个有序数组(2)", LeetCode0088::class.java, 2))

    }

    override fun clickItem(bean: BaseMenuBean) {
        val intent = Intent(this, AlgorithmV3MainActivity::class.java)
        intent.putExtra("code", bean.code)
        intent.putExtra("targetClass", bean.targetClass)
        startActivity(intent)
    }
}